// import JSEncrypt from 'jsencrypt';
//
// // 加密是公钥
// const publicKey = `-----BEGIN PUBLIC KEY-----
// MIGeMA0GCSqGSIb3DQEBAQUAA4GMADCBiAKBgH6ozeOjvpsAy2VEtbrUbl0yiTaW
// NT9CeZk5dVx/UwbAa/QFmR7bMQpRgxrcAyCZfEYtO8Scxx4dtbCr5FCevs0ktWzB
// rww9HXkRRuSXQv+RCPH6wUvBFZ12n2b2OGAPy/dg55vgEjEyyjdORFJBeJZ4QOs4
// zk4llJIYcPcn7VJNAgMBAAE=
// -----END PUBLIC KEY-----`
//
// const privateKey = `-----BEGIN RSA PRIVATE KEY-----
// MIICWgIBAAKBgH6ozeOjvpsAy2VEtbrUbl0yiTaWNT9CeZk5dVx/UwbAa/QFmR7b
// MQpRgxrcAyCZfEYtO8Scxx4dtbCr5FCevs0ktWzBrww9HXkRRuSXQv+RCPH6wUvB
// FZ12n2b2OGAPy/dg55vgEjEyyjdORFJBeJZ4QOs4zk4llJIYcPcn7VJNAgMBAAEC
// gYARwk9j/KCMETdzkoe8k26KCLzud28t2H8+Oa038+5LQw2f4G0Qw4EDxlwQlwql
// NoATQuJfdfABS/8er2tK1oc//7xj7V3kDeNutDNMZmr23RvbNCitluRUTEACrVqo
// deboeSqIgSLX3mhqn0Eg9v1azxjwV5yQxPfrinNHBk8CTQJBALu/nLduHqyikcMG
// EvarcQgSWj1leJEJrTVTll2Z7C+/Q5g2n82befaB2Celyy/BLpSGTrRgbXVjjpvu
// LPNlaWMCQQCstBLozK/Vh6ysAABMuZ74Uzdt6DAG9M9WRAQnXHV5tjdcn+Neu6rq
// JS82yN4nhXzFgi8R/EGm5SNnJdZybvyPAkAxCsFGDObIU4LdvZVwh6Hz6M9XoEzZ
// Hfz3pAjwFEfkxQJEHWiqzYUTRiGPYbhslfqz401lwpZ1Bnd29cUaIxBfAkAF9fkp
// G9d90T7+eMmJ3GZGP+kL3BW8R7rYSWSzTxem6ckjY0lfva56gmoMxAYW6x6RWprx
// TfmeHw6HwuCR9o61AkAOamgchoxAGU5M1TAV5m7TMXX73Jdy3VFarx74VkyGc8iW
// 29PP2UrnTakO4lP59KjuialfFvP3bpBJ5ILSCSY3
// -----END RSA PRIVATE KEY-----`
//
// export const useEncryptData = (plaintext) => {
//     const encrypt = new JSEncrypt();
//     encrypt.setPublicKey(publicKey);
//     return encrypt.encrypt(plaintext);
// }
//
// export  const useDecryptData = (encryptedText) => {
//     const decrypt = new JSEncrypt();
//     decrypt.setPrivateKey(privateKey);
//     try {
//         return decrypt.decrypt(encryptedText);
//     } catch (error) {
//         return  'Decryption failed';
//     }
// }